// import "antd/dist/antd.less";
import React from "react";
import ReactDOM from "react-dom";
import { BrowserRouter, HashRouter } from "react-router-dom";
import App from "./App";
import axios from "axios";
import { ConfigProvider } from "antd"; //全局化配置
import zh_CN from "antd/lib/locale-provider/zh_CN"; //antd中文
import "moment/locale/zh-cn"; //moment时间格式中文
import { Provider } from "mobx-react";
import { newStore } from "@/store";
import * as serviceWorker from "./serviceWorker";
// import { ErrorBoundary } from "@/component";

import RouteList from "@/pages/RouteList";
import "./antd-theme.less";
import "./antd-theme-online.less";
// 获取项目配置
axios.get(window.location.origin + "/config.json").then((res) => {
  // console.log("获取项目配置==", res);
  window.APP_CONFIG = res.data;
});
ReactDOM.render(
  <Provider {...newStore}>
    <ConfigProvider locale={zh_CN}>
      <BrowserRouter>
        <RouteList />
        <App />
      </BrowserRouter>
    </ConfigProvider>
  </Provider>,
  document.getElementById("root")
);

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
